package com.eastwit.api.controller.funing;

import com.eastwit.api.service.funing.InfoGetService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @description:定时拉取上级数据库阜宁设备到本机新建表
 * @author: cyy
 **/
@Slf4j
@Component
@EnableScheduling
public class InfoGetController {

    @Autowired
    private InfoGetService infoGetService;

    @Async
    @Scheduled(cron = "${fn.cron}")
    public void run() throws InterruptedException {
        log.info("funing info get start");
        infoGetService.startGetInfo();
    }


}

